﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="JDMovieList.aspx.vb" Inherits="JohnnyDepp.JDMovieList" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
        <style type="text/css">
                        .filledRatingStar {background-image: url(Pictures/FilledStar.png); width:12px; height:12px;}
                        .emptyRatingStar {background-image: url(Pictures/EmptyStar.png); width:12px; height:12px;}
                        .savedRatingStar {background-image: url(Pictures/SavedStar.png); width:12px; height:12px;}
                   </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        List of Tags</p>
    <p>
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="TagSqlDataSource">
           <ItemTemplate>
                <a href ="JDMovieList.aspx?TagName=<%# Eval("TagName") %>"> 
                <%# Eval("TagName") %>
                </a> | 
           </ItemTemplate>
        </asp:Repeater>
        <a href ="JDMovieList.aspx">Show all</a>
</p>
    <p>
        <asp:SqlDataSource ID="TagSqlDataSource" runat="server" 
            ConnectionString="<%$ ConnectionStrings:JDFanConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:JDFanConnectionString.ProviderName %>" 
            SelectCommand="SELECT * FROM [Tags]"></asp:SqlDataSource>
</p>
    <p>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" 
            Width="612px">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="JDMovieDetails.aspx?ID={0}" 
                DataTextField="Movie_Name" HeaderText="Movie Name" />
            <asp:TemplateField HeaderImageUrl="~/Pictures/th_rating_41.gif" HeaderText="Stars">
                <ItemTemplate>
                    <asp:Rating ID="Rating1" runat="server" CurrentRating='<%# getStars(Eval("Rating"))%>'
                                EmptyStarCssClass="emptyRatingStar" 
                                FilledStarCssClass="filledRatingStar" 
                                WaitingStarCssClass="savedRatingStar" 
                                StarCssClass="ratingStar"
                                Direction="LeftToRight">
                     </asp:Rating>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Movie_Category" HeaderText="Movie_Category" 
                SortExpression="Movie_Category" />
            <asp:ImageField DataImageUrlField="Poster" HeaderText="Movie Poster">
                <ControlStyle CssClass="JDFPosters" />
            </asp:ImageField>
        </Columns>
    </asp:GridView>
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
        </asp:ToolkitScriptManager>
</p>
    <p>
    <asp:SqlDataSource ID="JDFanSqlDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:JDFanConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:JDFanConnectionString.ProviderName %>" 
        
            SelectCommand="SELECT * FROM [JDF_List]">
    </asp:SqlDataSource>
</p>
    <p>
        &nbsp;</p>
    <asp:SqlDataSource ID="JDFViewSqlDataSource" runat="server" 
        ConnectionString="<%$ ConnectionStrings:JDFanConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:JDFanConnectionString.ProviderName %>" 
        
            
        
        
        SelectCommand="SELECT DISTINCT [Movie_Name], [TagName], [Rating], [Director_Name], [Role_of_JD], [Description], [Movie_Category], [Movie_Business], [Poster], [ID] FROM [JDFTagView] WHERE ([TagName] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="TagName" QueryStringField="TagName" 
                Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <p>
        <asp:Button ID="Button1" runat="server" PostBackUrl="~/AddJDMovie.aspx" 
            Text="Add New JDMovie" />
    <br />
</p>
</asp:Content>
